package spring.cloud.tasks.executor.listener.failover;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import spring.cloud.tasks.executor.utils.execute_callback.LeaderExecuteCallback;
import spring.cloud.tasks.executor.utils.log.LogUtils;

@Slf4j
@Setter
@Getter
class FailoverTimeoutLeaderExecuteCallback implements LeaderExecuteCallback {

    private final FailoverService failoverService;

    public FailoverTimeoutLeaderExecuteCallback(FailoverService failoverService) {
        this.failoverService = failoverService;
    }

    @Override
    public void execute() {
        LogUtils.warn(log, failoverService.taskId, "Failover leader election timeout with a minute");
    }
}
